package com.acme.task3;

public class Task3Arrays {

	double avg(int[] a) {
		/**
		 * avg method calculates average value of an array
		 */
		long summa = 0;
		for (int i = 0; i < a.length; i++) {
			summa = summa + a[i];
		}
		return ((double) summa / a.length);
	}

	public static void main(String[] args) {
		int[] myarray = new int[1000];
		for (int i = 0; i < myarray.length; i++) {

			myarray[i] = i + 1;
		}

		int m = 3;
		String str1 = "Number ";
		String str2 = " a multiple of three";
		for (int i = 1; i <= 50; i++) {
			if (i % m == 0) {
				System.out.println(str1 + i + str2);
			}
		}
		Task3Arrays as = new Task3Arrays();
		System.out.println(as.avg(myarray)); // Return the average of the array

	}
}
